package top.songxs.gmall.product.rpc;

import org.checkerframework.framework.qual.RequiresQualifier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.songxs.gmall.common.result.Result;
import top.songxs.gmall.product.entity.SpuSaleAttr;
import top.songxs.gmall.product.rpc.biz.SpuSaleAttrRpcService;

import java.util.List;

@RestController
@RequestMapping("api/inner/product")
public class SpuSaleAttrRpcController {
    @Autowired
    private SpuSaleAttrRpcService spuSaleAttrRpcService;

    @GetMapping("/findSpuSalAttrAndValueBySkuId/{skuId}")
    public Result<List<SpuSaleAttr>> findSpuSalAttrAndValueBySkuId(@PathVariable("skuId") Long skuId) {
        List<SpuSaleAttr> list = spuSaleAttrRpcService.findSpuSalAttrAndValueBySkuId(skuId);
        return Result.ok(list);


    }


}
